package com.itheima.service.impl;

import com.itheima.dao.UserDao;
import com.itheima.service.UserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class UserServiceImpl implements UserService {

    //通过UserDao的set方法，把UserDao注入到UserServiceImpl中(相当于@Autowired)
    private UserDao userDao;
    //set方法注入userDao
    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }

    //有参构造方法注入userDao
/*
    public UserServiceImpl(UserDao userDao) {
        this.userDao = userDao;
    }
*/

    public UserServiceImpl() {

    }

    public void save() {
        userDao.save();
    }
}
